var dataAxis = ['1', '2', '3', '3', '4', '5', '6', '7', '8', '9', '10'];
var data = [220, 182, 191, 234, 290, 330, 310, 123, 442, 321];
var yMax = 500;
var dataShadow = [];

for (var i = 0; i < data.length; i++) {
    dataShadow.push(yMax);
}
export default {
    //backgroundColor: '#2c343c',
    title: {
        text: '7#尼龙正拉排产动态',
        left: 'center',
        subtext: '',
        textStyle: {
            color: '#ccc'
          }
    },
    xAxis: {
        splitLine: {
            show: false
        },
        data: dataAxis,
        axisTick: {
            show: false
        },
        axisLine: {
            show: true
        },
        z: 10
    },
    yAxis: {
        splitLine: {
            show: false
        },
        axisLine: {
            show: true
        },
        axisTick: {
            show: false
        },
        axisLabel: {
            textStyle: {
                color: '#999'
            }
        }
    },
    dataZoom: [
        {
            type: 'inside'
        }
    ],
    series: [
        { // For shadow
            type: 'bar',
            itemStyle: {
                normal: {color: 'rgba(0,0,0,0.05)'}
            },
            barGap:'-100%',
            barCategoryGap:'40%',
            data: dataShadow,
            animation: false
        },
        {
            type: 'bar',
            data: data
        }
    ]
};


// // Enable data zoom when user click bar.
// var zoomSize = 6;
// myChart.on('click', function (params) {
//     console.log(dataAxis[Math.max(params.dataIndex - zoomSize / 2, 0)]);
//     myChart.dispatchAction({
//         type: 'dataZoom',
//         startValue: dataAxis[Math.max(params.dataIndex - zoomSize / 2, 0)],
//         endValue: dataAxis[Math.min(params.dataIndex + zoomSize / 2, data.length - 1)]
//     });
// });